import request from '@/utils/request'

// 查询流程定义列表
export function listBpmninfo(query) {
  return request({
    url: '/workflow/bpmninfo/list',
    method: 'get',
    params: query
  })
}

// 查询流程定义详细
export function getBpmninfo(id) {
  return request({
    url: '/workflow/bpmninfo/' + id,
    method: 'get'
  })
}

// 新增流程定义
export function addBpmninfo(data) {
  return request({
    url: '/workflow/bpmninfo',
    method: 'post',
    data: data
  })
}

// 修改流程定义
export function updateBpmninfo(data) {
  return request({
    url: '/workflow/bpmninfo',
    method: 'put',
    data: data
  })
}

// 删除流程定义
export function delBpmninfo(id) {
  return request({
    url: '/workflow/bpmninfo/' + id,
    method: 'delete'
  })
}
//流程部署
export function deploy(formData){
     return request(
      {
        url:'workflow/bpmninfo/deploy',
        method:'post',
        data:formData, 
        Headers:{'Content-Type':'multipart/form-data'}
      }
     )
}
export function view(id,type){
  return request({
    url: '/workflow/bpmninfo/view/'+id,
    method: 'get',
    params: {type}
  })
}